'use strict';
const db = uniCloud.database();
const floorsCollection = db.collection('floors');

exports.main = async (event, context) => {
	// 获取楼层列表，按楼层号排序
	const { data: floors } = await floorsCollection
		.orderBy('floor_number', 'asc')
		.get();
	
	return {
		code: 0,
		message: '获取楼层列表成功',
		data: floors
	};
}; 